package tech.aistar.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import tech.aistar.model.dto.Code;
import tech.aistar.model.dto.Result;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler(FormTokenException.class)
    public Result handler(FormTokenException e){
        return new Result(Code.BAD,e.getMessage());
    }
}
